﻿/* This Component Library is licensed under the GNU General Public License version 2 (GPLv2) 
 * You can use this software and its associated files as you wish so long as derived versions
 * or works based on this library are also freely released.
 * If you require a commercial licence for this software without the above restrictions please
 * contact me via scott_blood@hotmail.com or via CodePlex.
 * (c) 2010 Scott Blood
 * Visit SGBControls.CodePlex.com for the latest version of this library.
 */ 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SGBControls.Editors
{
    [ToolboxBitmap(typeof(SGBEditStyleController))]
    public partial class SGBEditStyleController : Component
    {
        public event EventHandler Invalidated;

        protected internal Color fActiveBackgroundColor = SystemColors.Info;
        protected internal Color fActiveForeColor = SystemColors.InfoText;
        protected internal Color fInactiveBackgroundColor = SystemColors.Window;
        protected internal Color fInactiveForecolor = SystemColors.WindowText;
        protected internal BorderStyles fBorderStyle = BorderStyles.Flat;
        protected internal Color fBorderColor = SystemColors.WindowFrame;
        private Color fSelectedItemForeColor = SystemColors.HighlightText;
        private Color fSelectedItemBackColor = SystemColors.Highlight;

        [Description("Gets or sets the Forecolor used for selected items within the Edit Control")]
        public Color SelectedItemForeColor
        {
            get
            {
                return fSelectedItemForeColor;
            }
            set
            {
                fSelectedItemForeColor = value;
            }
        }

        [Description("Gets or sets the background color used for selected items is selected within the Edit Control")]
        public Color SelectedItemBackColor
        {
            get
            {
                return fSelectedItemBackColor;
            }
            set
            {
                fSelectedItemBackColor = value;
            }
        }

        [Description("Gets or sets the color used to draw borders around the editor control")]
        public Color BorderColor
        {
            get
            {
                return fBorderColor;
            }
            set
            {
                if (value != fBorderColor)
                {
                    fBorderColor = value;
                    if (Invalidated != null)
                        Invalidated(this, new EventArgs());
                }
            }
        }

        [Description("Gets or sets the style used to draw borders around the editor control")]
        public BorderStyles BorderStyle
        {
            get
            {
                return fBorderStyle;
            }
            set
            {
                if (value != fBorderStyle)
                {
                    fBorderStyle = value;
                    if (Invalidated != null)
                        Invalidated(this, new EventArgs());
                }
            }
        }

        [Description("Gets or sets the background color used when an editor control has the focus")]
        public Color ActiveBackgroundColor
        {
            get
            {
                return fActiveBackgroundColor;                
            }
            set
            {
                fActiveBackgroundColor = value;
            }
        }

        [Description("Gets or sets the Forecolor used when an editor control has the focus")]
        public Color ActiveForeColor
        {
            get
            {
                return fActiveForeColor;
            }
            set
            {
                fActiveForeColor = value;
            }
        }

        [Description("Gets or sets the background color used when an editor control does not have the focus")]
        public Color InActiveBackgroundColor
        {
            get
            {
                return fInactiveBackgroundColor;
            }
            set
            {
                fInactiveBackgroundColor = value;
            }
        }

        [Description("Gets or sets the Forecolor used when an editor control does not have the focus")]
        public Color InActiveForeColor
        {
            get
            {
                return fInactiveForecolor;
            }
            set
            {
                fInactiveForecolor = value;
            }
        }

        public SGBEditStyleController()
        {
            
        }        
    }
}
